package com.xiaoq.flowrate.endpoint;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.xiaoq.coms.GenericDataResponse;
import com.xiaoq.flowrate.service.IFlowrateService;
import com.xiaoq.sites.vo.TouristStaticsVo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;

@Api(tags={"测试景区流量相关接口"})
@RestController
@RequestMapping("/api/v1/flowrate")
public class FlowrateEndpoint {
	private class TouristStaticsResponse extends GenericDataResponse<TouristStaticsVo>{}
	
	@Autowired
	private IFlowrateService flowrateSer;
	
	@ApiOperation(value = "获取景区实时流量", notes = "获取景区实时流量")
	@ApiResponses({ @ApiResponse(code = 200, response = TouristStaticsResponse.class, message = "获取景区实时流量") })
	@GetMapping(value = "", produces = { MediaType.APPLICATION_JSON_UTF8_VALUE })
	public ResponseEntity<?> getTouristStatics(
			@RequestParam(value="sitesId") String sitesId,
			@RequestParam(value="capacity") Long capacity) {
		TouristStaticsVo  toutist = flowrateSer.findTouristStatics(sitesId,capacity);
		return TouristStaticsResponse.okWithData(toutist);
		
	}

}
